// 引入windi css
import '@/plugins/windi.css'

// 导入全局的svg图标
import '@/plugins/svgIcon'

// 初始化多语言
import {setupI18n} from '@/plugins/vueI18n'

// 引入状态管理
import {setupStore} from '@/store'

// 全局组件
import {setupGlobCom} from '@/components'

// 引入element-plus
import {setupElementPlus} from '@/plugins/elementPlus'

// 引入全局样式
import '@/styles/index.less'

// 引入动画
import '@/plugins/animate.css'

// 路由
import {setupRouter} from './router'

//图标
import * as ElIconModules from '@element-plus/icons-vue'

//echarts
import * as echarts from 'echarts'

//打印
import print from 'vue3-print-nb'

import vue3SeamlessScroll from 'vue3-seamless-scroll'

import {createApp} from 'vue'

import App from './App.vue'

import './permission'

const setupAll = async () => {
    const app = createApp(App)

    await setupI18n(app)

    setupStore(app)

    setupGlobCom(app)

    setupElementPlus(app)

    setupRouter(app)

    //icon
    for (let iconName in ElIconModules) {
        app.component(iconName, ElIconModules[iconName])
    }

    app.config.globalProperties.$echarts = echarts
    app.config.globalProperties.$dy = []


    app.use(print)

    app.use(vue3SeamlessScroll)

    app.mount('#app')
}

setupAll()
